<?php

namespace app\admin\validate;

use think\Validate;

class Crontab extends Validate
{    
    /**
     * 验证规则
     */
    protected $rule = [
        'type'  => 'require|max:10',
        'title|标题'  => 'require|max:100',    
        'content' => 'require',
        'schedule' => 'require|max:100',
        'sleep|延迟执行' => 'integer|max:1',
        'maximums|最大执行次数' => 'require|max:10',
        'executes|累计执行次数' => 'integer|max:10',
        'executetime|最后执行时间' => 'require|max:10',
        'begintime|开始时间' => 'require|dateFormat:Y-m-d H:i:s',
        'endtime|结束时间' => 'require|dateFormat:Y-m-d H:i:s',
        'weigh' => 'require|integer|max:10',
        'status' => 'require|in:completed,expired,hidden,normal',
    ];

    /**
     * 提示消息
     */
    protected $message = [
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'add' => ['type', 'title', 'content', 'schedule', 'sleep', 'maximums', 'begintime', 'endtime'],
        'edit' => ['type', 'title', 'content', 'schedule', 'sleep', 'maximums', 'begintime', 'endtime'],
    ];
    
}
